﻿<%@ Page Language="C#" MasterPageFile="~/Shared/Masters/List.master" AutoEventWireup="true" Theme ="Default"
    CodeFile="ModTargetApply.aspx.cs" Inherits="Modules_Personal_ModTargetApply" Title="Untitled Page" %>

<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register TagPrefix="web" TagName="listtitle" Src="~/Shared/UserControls/ListTitle.ascx" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register Assembly="YYControls" Namespace="YYControls" TagPrefix="yyc" %>
<asp:Content ContentPlaceHolderID="idList" ID="idListContent" runat="server">
<script language="javascript" type="text/javascript">
    function selectAll()
    {
        var a = document.getElementsByTagName("input");
        var all = document.getElementById("alls");
        for (var i=0; i<a.length; i++)
        {
            if(all.checked)
            {
                if (a[i].type == "checkbox") 
                {
                    a[i].checked = true;
                }
            }
            else
            {
                if (a[i].type == "checkbox") 
                {
                    a[i].checked = false;
                }
            }
        }
    }
    function cancelAll()
    {
        var a = document.getElementsByTagName("input");
        for (var i=0; i<a.length; i++)
        {
            if (a[i].type == "checkbox") 
            {
                a[i].checked = false;
            }
        }
    }
</script>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div class="crumb">
        <asp:Label runat="server" ID="lblTitle" Text="分配指标修改"></asp:Label>
    </div>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <contenttemplate><div id="searchContainer" runat="server">
        <div class="search" id="search">
        <table cellpadding="2" cellspacing="0" class="rtm_shb_b">
            <tr>
                <td style="width:50px">
                    <asp:Label runat="server" ID="lblPost" Text="岗位："></asp:Label>
                </td>
                <td style="width:125px;">
                    <asp:DropDownList ID="ddlSearchPost" runat="server"></asp:DropDownList>
                </td>
                <td style="width:50px;"><asp:Label ID="lblTargetOwner" runat="server" Text="指标套："></asp:Label></td>
                <td style="width:125px;">
                    <asp:DropDownList ID="ddlSearchTo" runat="server"></asp:DropDownList>
                </td>
                <td style="width:50px;"><asp:Label ID="Label1" runat="server" Text="状态："></asp:Label></td>
                <td style="width:125px;">
                    <asp:DropDownList ID="ddlSearchStatus" runat="server"></asp:DropDownList>
                </td>
                <td class="rtm_shb_btn" style="white-space: nowrap">
                    <asp:Button ID="btnSearch" runat="server" Text="查询" OnClick="btnSearch_Click"></asp:Button>&nbsp;
                    <asp:Button ID="ResetLinkButton" runat="server" Text="重置" OnClientClick="reset();return false;">
                    </asp:Button>
                </td>
            </tr>
        </table>
    </div>
    <div class="toolbar" id="toolbar">
        <span style="font-weight:bold;height:30px;"><h2>
            <web:listtitle ID="Listtitle1" runat="server" Title="分配指标修改" />
        </h2></span>
        <asp:LinkButton ID="btnCreate" runat="server" OnClientClick="return sureApply();" OnClick="CreateButton_Click">
            <asp:Label ID="lblCreatNew" runat="server" Text="">
                <img runat="server" id="imgNew" src="../../Images/icon_new.gif" style="border: 0px" />呈批</asp:Label>
        </asp:LinkButton>
    </div></div>
    <yyc:SmartGridView ID="gvModTargetList" runat="server" AutoGenerateColumns="False" AllowSorting="True" OnSorting="gvModTargetList_Sorting" OnRowCommand="gvModTargetList_RowCommand" OnRowDataBound="gvModTargetList_RowDataBound"
        EmptyDataText="没有找到数据!">
        <FixRowColumn FixRowType="Header,Pager" FixColumns="0,1"></FixRowColumn>

        <Columns>
         <asp:TemplateField>
                <HeaderTemplate>
                    <div><input type="checkbox" id="alls" name="all" onclick="selectAll()" /></div>
                </HeaderTemplate>
                <ItemTemplate>
                    <input type="checkbox" name="chkSelected" id="chkSelected" runat="server"
                        value='<%# DataBinder.Eval(Container.DataItem,"ID") %>' />
                </ItemTemplate>
                <controlstyle forecolor="Black" />
                <headerstyle wrap="False" horizontalalign="Center" />
                <itemstyle horizontalalign="Center" forecolor="Black" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="操作">
                <itemtemplate>
                    <table width="46px" style="text-align: left">                    
                        <tr>
                            <td style="border: 0px solid #fff;">
                                <asp:ImageButton runat="server" CommandName="view" CommandArgument='<%# Eval("ID") %>' CausesValidation="False"  ImageUrl="~/Images/icon_srh.gif" ToolTip="查看详细" ID="ibtnView" ></asp:ImageButton>
                            </td>
                            <td style="border: 0px solid #fff;">
                                <asp:ImageButton runat="server" CommandName="flow" _ID='<%# Eval("Flow_Trace_ID") %>' OnClientClick="return viewFlow(this, 'flow');" CausesValidation="False"  ImageUrl="~/Images/icon_tool_042.gif" ToolTip="查看审批详细" ID="ibtnViewFlow" ></asp:ImageButton>
                            </td>
                        </tr>
                    </table>
</itemtemplate>
                <controlstyle forecolor="Black" />
                <headerstyle wrap="False" horizontalalign="Center" />
                <itemstyle horizontalalign="Center" forecolor="Black" />
            </asp:TemplateField>
            <asp:BoundField DataField="Post_ID" HeaderText="岗位" SortExpression="Post_ID" />
            <asp:BoundField DataField="TargetUser_ID" HeaderText="人员" SortExpression="TargetUser_ID" />
            <asp:BoundField DataField="TargetOwner_ID" HeaderText="指标套" SortExpression="TargetOwner_ID" />
            <asp:BoundField DataField="Create_Time" HeaderText="日期" SortExpression="Create_Time" />
            <asp:BoundField DataField="User_ID" HeaderText="修改人" SortExpression="User_ID" />
            <asp:BoundField DataField="Status" HeaderText="状态" SortExpression="Status" />
            <asp:BoundField DataField="Remark" HeaderText="备注" SortExpression="Remark" />
        </Columns>
        <FixRowColumn FixRowType="Header,Pager" FixColumns="" />
    </yyc:SmartGridView>
    <webdiyer:AspNetPager ID="AspNetPager" CssClass="aspNetPager" ShowBoxThreshold="1" OnPageChanged="AspNetPager_PageChanged"
        runat="server" HorizontalAlign="Right" PageSize="20" AlwaysShow="True" FirstPageText="首页"
        LastPageText="尾页" NextPageText="下一页" PrevPageText="上一页" Width="98%" CustomInfoClass="aspNetPager"
        LayoutType="Div" PageIndexBoxType="TextBox" ShowPageIndexBox="Auto">
    </webdiyer:AspNetPager>
     </contenttemplate>
    </asp:UpdatePanel>
    
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <contenttemplate>
        <div class="toolbar" id="divTargetTitle" runat="server">
        <h2>
            <web:listtitle ID="Listtitle2" runat="server" Title="指标列表" />
            ---<asp:Label ID="lblTargetUserName" runat="server" Text=""></asp:Label>
            <asp:HiddenField ID="hdnSelectedModTargetID" runat="server" Value="" />
        </h2>
        <asp:LinkButton ID="lbtnBack" runat="server" OnClick="LBtnBack_Click">
            <asp:Label ID="Label2" runat="server" Text="">
                &nbsp;&nbsp;返回</asp:Label>
        </asp:LinkButton>&nbsp;
        <asp:LinkButton ID="lbtnCreate" runat="server" OnClientClick="return openEditor(this, 'add');" OnClick="CreateTarget_Click" >
            <asp:Label ID="Label3" runat="server" Text="">
                &nbsp;&nbsp;新建</asp:Label>
        </asp:LinkButton>
    </div>
            <yyc:SmartGridView ID="gvTargetList" runat="server" AutoGenerateColumns="False" AllowSorting="True" OnSorting="gvTargetList_Sorting" OnRowCommand="gvTargetList_RowCommand" OnRowDataBound="gvTargetList_RowDataBound"
                EmptyDataText="没有找到数据!">
                <FixRowColumn FixRowType="Header,Pager" FixColumns="0,1"></FixRowColumn>

                <Columns>
                    <asp:TemplateField HeaderText="操作">
                        <itemtemplate>
                            <table width="46px" style="text-align: left">                    
                                <tr>
                                    <td style="border: 0px solid #fff;">
                                        <asp:ImageButton runat="server" CommandName="del" CommandArgument='<%# Eval("ID") %>' CausesValidation="False"  OnClientClick="return sureDelete();" ImageUrl="~/Images/com/dg_del.gif" ToolTip="删除" ID="ibtnDelete" ></asp:ImageButton>
                                    </td>
                                </tr>
                            </table>
        </itemtemplate>
                        <controlstyle forecolor="Black" />
                        <headerstyle wrap="False" horizontalalign="Center" />
                        <itemstyle horizontalalign="Center" forecolor="Black" />
                    </asp:TemplateField>
                    <asp:BoundField DataField="Target_ID" HeaderText="代码"/>
                    <asp:BoundField DataField="Target_ID" HeaderText="名称" />
                    <asp:BoundField DataField="Target_ID" HeaderText="指标类型" />
                    <asp:BoundField DataField="Target_ID" HeaderText="分值"/>
                    <asp:BoundField DataField="Target_ID" HeaderText="是否必选" />
                    <asp:BoundField DataField="Type" HeaderText="状态" SortExpression="Type" />
                    <asp:BoundField DataField="Remark" HeaderText="备注" SortExpression="Remark" />
                </Columns>
                <FixRowColumn FixRowType="Header,Pager" FixColumns="" />
            </yyc:SmartGridView>
        </contenttemplate>
    </asp:UpdatePanel>

    <script type="text/javascript">
        function openEditor(_this, action) {
            var url = "ModTargetAdd.aspx";
            var toId = document.getElementById("ctl00_idList_hdnSelectedModTargetID");
            url = url + "?modId=" + toId.value;
            return default_openEditor(url, _this, action, 750, 200,true);
        } 
        
        function sureDelete()
        {
             return confirm("您确认要删除吗?");        
        }
        
        function sureApply() {
            return window.confirm("确认要呈批吗？");
        }
        
        function viewFlow(_this,action) {
            var url = "../FlowTrace/TraceDetail.aspx";
            
            return default_openEditor(url, _this, action, 750, 450,true);
        }
    </script>

</asp:Content>
